Question: In an increasing sequence of four positive integers, the first three terms form an arithmetic progression, the last three terms form a geometric progression, and the first and fourth terms differ by $30.$ Find the sum of the four terms.
Explanation: Denote the first three terms by $a,$ $a+d,$ and $a+2d,$ where $a$ and $d$ are positive integers; then the fourth term is $a+30.$ Since the last three terms form an arithmetic sequence, we have \[(a+d)(a+30) = (a+2d)^2,\]or \[a^2 + (30+d) a + 30d = a^2 + 4ad + 4d^2.\]Solving for $a,$ we get \[a = \frac{4d^2-30d}{30-3d} = \frac{2d(2d-15)}{3(10-d)}.\]Since $a$ is positive, we must have $f(d) = \frac{d(2d-15)}{10-d} > 0.$ We construct a sign table for this expression: \begin{tabular}{c|ccc|c} &$d$ &$2d-15$ &$-d+10$ &$f(d)$ \\ \hline$d<0$ &$-$&$-$&$+$&$+$\\ [.1cm]$0<d<\frac{15}{2}$ &$+$&$-$&$+$&$-$\\ [.1cm]$\frac{15}{2}<d<10$ &$+$&$+$&$+$&$+$\\ [.1cm]$d>10$ &$+$&$+$&$-$&$-$\\ [.1cm]\end{tabular}Since $d > 0,$ we must have $\tfrac{15}{2} < d < 10,$ which only gives two possible integer values for $d,$ namely $8$ and $9.$ For $d=8,$ we get \[a = \frac{2 \cdot 8 \cdot 1}{3 \cdot 2} = \frac{8}{3},\]which is not an integer, so we must have $d=9$ and \[a = \frac{2 \cdot 9 \cdot 3}{3 \cdot 1} = 18.\]Then the sum of the four terms is \[a + (a+d) + (a+2d) + (a+30) = 18 + 27 + 36 + 48 = \boxed{129}.\]